package com.xquant.pricing.calc.service;

import com.xquant.common.engine.xPP.request.CalcEngineParam;
import com.xquant.common.engine.xPP.response.CalcResult;

public interface CalcCommonService {
    String[] getSupportedProductType();

    String getSupportedRequestCode();

    CalcEngineParam getCalcPricingParamByCfgId(CalcEngineParam param, String cfgId);
    CalcEngineParam getCalcPricingParamByCfgIdWarpperWithInterpolation(CalcEngineParam param, String cfgId);

    /**
     * 合并参数，理论上，有cfgid，使用cfgid的参数，标的价格使用传入的。
     * @param
     * @return com.xquant.tradeplat.xPP.request.CalcEngineParam
     **/
    CalcEngineParam mergeCalcPricingParam(CalcEngineParam calcPricingParamDefault, CalcEngineParam calcPricingParamNew);

    String getDefaultCfgId(String cfgId);

    Boolean isUseDefaultPricingParam(CalcEngineParam param,String requestCode);

    default CalcResult  beforeCalc(CalcEngineParam param){
        CalcResult calcResult = new CalcResult();
        calcResult.setErrorCode("0");
        return calcResult;
    }

    void afterCalc(CalcResult param);
}
